<template>
  <div class="zhengxuangu-box">
    <template v-for="item in parseAnswers">
      <txt2 v-if="item.show_type === 'txt2'" :configData="item.components[0]"></txt2>
      <zhenxuangu v-else :answers="item" :intent="session.response.answer[0].intent" />
    </template>
  </div>
</template>
<script>
import zhenxuangu from "./zhenxuangu";
import txt2 from "./txt2";
import { globalAnswerParse } from "@/utils/globalAnswerProcess";
export default {
  components: {
    zhenxuangu,
    txt2
  },
  data() {
    return {
      parseAnswers: []
    };
  },
  created() {
    this.parseAnswers = globalAnswerParse(this.answers.content);
    console.log("%c", "color: #FF8A00;font-size:20px;", this.parseAnswers);
  },
  props: {
    answers: {
      type: [Array, Object],
      default: () => [] || {}
    },
    session: Object
  }
};
</script>
